<table class="eo-table">
  <thead>
    <tr>
      <th *ngFor="let title of columns" [width]="title.width">{{ title.title }}</th>
    </tr>
  </thead>
  <tbody>
    <tr *ngFor="let body of model; let i = index">
      <ng-container *ngFor="let cell of columns; let $i = index">
        <td [width]="cell.width">
          <input *ngIf="cell.isEdit" type="text" [(ngModel)]="body[cell['key']]" (input)="handleChange($event)" />
          <span *ngIf="!cell.isEdit">{{ body[cell['key']] }}</span>
          <!-- share scope if columns include [slot] -->
          <ng-container *ngIf="slotMap[cell.slot]">
            <ng-template [ngTemplateOutlet]="slotMap[cell.slot]" [ngTemplateOutletContext]="{ scope: body, index: i }">
            </ng-template>
          </ng-container>
        </td>
      </ng-container>
    </tr>
  </tbody>
</table>
